/**
 * MetasoCreator前端应用入口文件
 * 功能：配置Vue应用、Element Plus UI库、状态管理等
 * 作者：AI Assistant
 * 创建时间：2024-12-25
 */
/**
 * 应用入口文件
 * 功能：初始化Vue应用，配置路由、状态管理、UI组件库等
 * 作者：AI Assistant
 * 创建时间：2025-01-15
 */
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './styles/themes.css'
import './styles/responsive.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from './router'
import './styles/global.css'
import { useAppStore } from './stores/counter'

const app = createApp(App)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 配置应用插件
const pinia = createPinia()
app.use(pinia)
app.use(router)
app.use(ElementPlus)

app.mount('#app')

// 初始化主题
const appStore = useAppStore()
appStore.initTheme()
